package com.elong.qadev.entity;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
 * 
* @ClassName: DBSql
* @Description: TODO(数据库SQL对应类model)
* @author kangchen
* @date 2015年10月2日
*
 */
@Entity
@Table(name = "DB_SQL", schema = "ti")
public class DBSql {
	public DBSql(int id, int dbLinkId, String sql, String configer,
			Date createDate) {
		super();
		this.id = id;
		this.dbLinkId = dbLinkId;
		this.sql = sql;
		this.configer = configer;
		this.createDate = createDate;
	}
	public DBSql() {
		super();
	}
	private int id;
	private int dbLinkId;
	private String sql;
	private String configer;
	private Date createDate;
	@Override
	public String toString() {
		return "DBSql [id=" + id + ", dbLinkId=" + dbLinkId + ", sql=" + sql
				+ ", configer=" + configer + ", createDate=" + createDate + "]";
	}
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "ID", unique = true, nullable = false, length = 10)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
    @Column(name = "DBLINK_ID", nullable = false, length = 10)
	public int getDbLinkId() {
		return dbLinkId;
	}
	public void setDbLinkId(int dbLinkId) {
		this.dbLinkId = dbLinkId;
	}
	@Lob 
	@Basic(fetch = FetchType.LAZY) 
	@Column(name="DBSQL", nullable=true)
	public String getSql() {
		return sql;
	}
	public void setSql(String sql) {
		this.sql = sql;
	}
	@Column(name = "CONFIGER",nullable = false, length = 20)
	public String getConfiger() {
		return configer;
	}
	public void setConfiger(String configer) {
		this.configer = configer;
	}
	@Temporal(TemporalType.TIMESTAMP)
    @Column(name = "CREATEDATE", length = 7)
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	
	
}
